package com.farm.configer.domain.ex;

/**
 * mysql 数据类型定义
 *
 * @author Wd
 *
 */
public enum FieldTypeEnum {
	VARCHAR("varchar", 0), LONGTEXT("longtext", 929496729), TEXT("text", 65535), INT("int", 10), FLOAT("float ", 36),
	DOUBLE("double ", 36);

	private String code;
	private int len;

	FieldTypeEnum(String code, int len) {
		this.code = code;
		this.len = len;
	}

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public int getLen() {
		return len;
	}

	public void setLen(int len) {
		this.len = len;
	}

	public static FieldTypeEnum get(String codeStr) {
		for (FieldTypeEnum node : values()) {
			if (codeStr.toLowerCase().equals(node.getCode().toLowerCase())) {
				return node;
			}
		}
		return null;
	}
}
